package com.dynabook.ems.model.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 盘点数据分页查询响应
 * @author tester
 */
@Data
@ApiModel(value = "盘点数据分页查询响应", description = "盘点数据分页查询结果")
@JsonInclude(JsonInclude.Include.NON_NULL)  // 自动排除null字段
public class InventoryDataPageVO implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * Sheet1数据：料件基本资料
     */
    @ApiModelProperty(value = "料件基本资料数据")
    private PageData<InventoryExportVO> basicInformation;
    
    /**
     * Sheet2数据：平均单耗（BOM）
     */
    @ApiModelProperty(value = "平均单耗数据")
    private PageData<AverageConsumptionExportVO> averageUnitConsumption;
    
    /**
     * Sheet3数据：盘点库存
     */
    @ApiModelProperty(value = "盘点库存数据")
    private PageData<InventoryStockExportVO> countingInventory;
    
    /**
     * 分页数据包装类
     */
    @Data
    @ApiModel(value = "分页数据", description = "通用分页数据结构")
    public static class PageData<T> implements Serializable {
        
        private static final long serialVersionUID = 1L;
        
        /**
         * 当前页码
         */
        @ApiModelProperty(value = "当前页码", example = "1")
        private Integer pageNum;
        
        /**
         * 每页大小
         */
        @ApiModelProperty(value = "每页大小", example = "100")
        private Integer pageSize;
        
        /**
         * 总记录数
         */
        @ApiModelProperty(value = "总记录数", example = "1000")
        private Long total;
        
        /**
         * 总页数
         */
        @ApiModelProperty(value = "总页数", example = "10")
        private Integer totalPages;
        
        /**
         * 数据列表
         */
        @ApiModelProperty(value = "数据列表")
        private List<T> records;
        
        /**
         * 是否有下一页
         */
        @ApiModelProperty(value = "是否有下一页", example = "true")
        private Boolean hasNext;
        
        /**
         * 是否有上一页
         */
        @ApiModelProperty(value = "是否有上一页", example = "false")
        private Boolean hasPrevious;
    }
}

